
public abstract class Item
{
	static int globalIDCounter=1;
	int objectID;
	double price;
	ItemState s;
	ItemState available;
	ItemState notAvailable;
	public Item(int price)
	{
		notAvailable=new NotAvailable(this);
		available=new Available(this);
		s=available;
		this.price=price;
		objectID=globalIDCounter;
		globalIDCounter++;
	}
	public int getID()
	{
		return objectID;
	}
	public boolean outgoing(CustomerAccount c)
	{
		return s.processOutgoing(c);
	}
	public boolean incoming()
	{
		return s.processIncoming();
	}
	public ItemState getAvailableState()
	{
		return available;
	}
	public ItemState getNotAvailableState()
	{
		return notAvailable;
	}
	public void setState(ItemState state)
	{
		s=state;
	}
	public double getPrice()
	{
		return price;
	}
}
